package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        File file = new File("./demo.txt");

        String name = file.getName();
        System.out.println("文件名字是:"+name);

        long len = file.length();
        System.out.println("文件大小为:"+len);

        boolean a = file.isHidden();
        boolean b = file.canRead();
        boolean c = file.canWrite();
        System.out.println("文件是否隐藏:"+a);
        System.out.println("文件是否可读:"+b);
        System.out.println("文件是否可写:"+c);


    }
}
